
export const getPrice = (item: any) => {
  const obj: any = {
    id: String(item.identification),
    title: item.timeFrame, //时段
    pricePower: `￥${item.pricePower.toFixed(4)}/度`, //电费
    priceService: `￥${item.priceService.toFixed(4)}/度`, //服务费
    sumPrice: `￥${item.sumPrice.toFixed(4)}`, //总计
    deletePricePower: '', //划线价格电费
    deletePriceService: '', //划线服务费
    deleteSumPrice: '', //划线总计
  };
  // 有优惠，展示优惠价格
  if (item.activitySumPrice) {
    obj.pricePower = `￥${item.activityPricePower}/度`; //电费
    obj.priceService = `￥${item.activityPriceService}/度`; //服务费
    obj.sumPrice = `￥${item.activitySumPrice}`; //总计
    // 原价>优惠价 展示划线价格-原价
    if (item.sumPrice > Number(item.activitySumPrice)) {
      obj.deleteSumPrice = `${item.sumPrice.toFixed(4)}`; //总计
      // 电费>优惠电费 且 服务费>优惠服务费
      if (item.pricePower > Number(item.activityPricePower)
        && item.priceService > Number(item.activityPriceService)) {
        obj.deletePricePower = `${item.pricePower.toFixed(4)}`; //电费
        obj.deletePriceService = `${item.priceService.toFixed(4)}`; //服务费
      }
    }
  }
  console.log('pp-----', obj);
  return obj;
}